<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改仓库类单据')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-receipt-edit" th:object="${wWarehouseReceipt}">
            <input name="wReceiptId" th:field="*{wReceiptId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">单据号：</label>
                <div class="col-sm-8">
                    <input name="wReceiptNumber" th:field="*{wReceiptNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">单据类型：</label>
                <div class="col-sm-8">
                    <select name="wReceiptType" class="form-control m-b" th:with="type=${@dict.getType('receipt_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">工单(生产类单据才会有工单)：</label>
                <div class="col-sm-8">
                    <input name="wWorkOrder" th:field="*{wWorkOrder}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">创建单据日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="wCreateDate" th:value="${#dates.format(wWarehouseReceipt.wCreateDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">补充说明：</label>
                <div class="col-sm-8">
                    <input name="wRemarks" th:field="*{wRemarks}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">物料类型：</label>
                <div class="col-sm-8">
                    <select name="materialType" th:with="type=${@dict.getType('materials_type')}" class="form-control m-b">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数量：</label>
                <div class="col-sm-8">
                    <input name="qty" th:field="*{qty}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">创建单据人id：</label>
                <div class="col-sm-8">
                    <input name="wCreatePersonId" th:field="*{wCreatePersonId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">创建人名字：</label>
                <div class="col-sm-8">
                    <input name="wCreatePersonName" th:field="*{wCreatePersonName}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "receipt/receipt";
        $("#form-receipt-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-receipt-edit').serialize());
            }
        }

        $("input[name='wCreateDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>